perm filename LECT11.TEX[ARK,TEX] blob
sn#766837 filedate 1984-08-22 generic text, type C, neo UTF8
COMMENT ⊗ VALID 00006 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 % copyright 1984 by Arthur Keller ... All rights reserved
C00006 00003 \section{Subscripts and Superscripts}
C00008 00004 \section{Square Roots and Fractions}
C00012 00005 \section{Finer Points of Math Mode}
C00016 00006 \section*{Assignment}
C00018 ENDMK
C⊗;
% copyright 1984 by Arthur Keller ... All rights reserved
\chapter{Mathematics Intro}
%Wed, August 22
%2-3pm
%Mathematics Intro
%>in-line formulas
%3-5pm
%<lab assignment 8>
\TeX's capabilities in typsetting mathematics are extensive, and indeed
the typesetting of mathematics provided the major impetus for the
development of \TeX.
\TeX\ will even do a better job of typesetting mathematics than most
professional typesetters, unless they have been specially trained to
handle mathematical text.
This lecture cannot hope to cover everything on this topic (which require
four chapters in the \TeX book); instead, it will focus on some of the
most basic points.
\TeX\ uses the symbol {\tt \$} to begin and end math mode.
A number of things happen differently inside math mode than in regular
horizontal mode:
all letters (but not digits or operator symbols) come out in italics;
\TeX\ ignores {\bf all} spaces inside math mode (however a blank space
still must follow each control word); the spacing around characters is
different.
There are also some keys on the terminal which produce different output
depending on whether or not \TeX\ is in math mode when they are used, and
some macros which are only available inside of math mode.
Whenever you're using \TeX, but especially in math mode, it's important to
be aware of the difference between the digit `0' and the letter `o', and
between the digit `1' and the letter `l'. Punctuation marks which follow
formulas, like $1+1=2$, should always come {\sl after} the {\tt\$} which
ends math mode, rather than being inside math mode, in order to look
right.
Let's look at an example of the difference between math mode and ordinary
horizontal mode.
Suppose we type {\tt f(x)=37x+4a+12}; here's how it looks:
\par\smallskip\noindent
$f(x)=37x+4a+12$\quad (inside math mode)
\par\noindent
f(x)=37x+4a+12\quad (not in math mode)
\section{Subscripts and Superscripts}
To get a superscript, type the caret (\caret), shift-6 on the Zenith
terminals); to get a superscript, type the underscore (\us).
If a super- or subscript consists of only one character, no braces are
needed; otherwise, the material to be super- or subscripted must be
enclosed in braces.
Otherwise, typing \mm{x\caret 2i} will result in $x↑2i$.
If you want to use the expression $x↑2_i$, it doesn't matter whether you
type \mm{x\caret2\us i} or \mm{x\us i\caret 2}.
If you want to raise $x$ to the power $a↑b$, type \mm{x\caret\lb a\caret
b\rb}; the alternative, \mm{\lb x\caret a\rb\caret b}, is incorrect, since
it results in ${x↑a}↑b$, where the `b' is in the same size as the `a'.
It is even possible to have expressions like $x↑{y↑a_b}_{z↑c_d}$, which is
obtained by typing \mm{x\caret\lb y\caret a\us b\rb\us\lb z\caret c\us
d\rb}.
To get an expression like $x'$ (``$x$ prime''), type either \mm{x\caret\bs
prime} or \mm{x'} (``$x$ apostrophe'').
To get the formula $x''$, use either \mm{x\caret\lb \bs prime\bs
prime\rb} or \mm{x''}.
\TeX\ automatically lines up super- and subscripts, so that an expression
like $x'_i$ comes out correctly.
\section{Square Roots and Fractions}
\mcmd{sqrt 4} will result in $\sqrt 4$.
If we want $\sqrt 4x$, however, we must type \mcmd{sqrt\lb4x\rb}, since
otherwise we will get $\sqrt4x$, which is really $x\sqrt4$.
The simplest way to get fractions is with the cmd{over} command, which
puts everything which precedes it (up to the beginning of math mode) {\sl
over} everything which follows (to the end of math mode).
No braces are needed unless you want to {\sl restrict} the scope of
\cmd{over} to include less than that.
Thus, \mm{3x\bs over 5y} results in $3x\over5y$.
For more complicated expressions, braces are necessary to get the
correct output.
We can get ${a\over b}\over 2$ by typing \mm{\lb a\bs over b\rb\bs over
2}, and ${a\over b}\over{c\over d}$ by typing \mm{\lb a\bs over b\rb\bs
over\lb c\bs over d\rb}.
We can widen the rule between the upper and lower parts of the fraction
for emphasis by typing \mm{\lb a\bs over b\rb\bs above 1pt\lb c\bs over
d\rb}; where the \cmd{above 1pt} creates a rule which is 1 point wide.
However, these expressions do not look very nice in running text, since
they tend to ``stick out'' and may force the lines to spread farther apart
than normal.
We will discuss an alternative way to type fractions later.
Since the \cmd{over} command does apply to everything before and after it,
if we want to use the expression $x↑{a\over b}$ we need to type
\mm{x\caret\lb a\bs over b\rb}.
The expression \mm{x\caret a\bs over b} would result in $x↑a\over b$ which
is something else entirely.
Let us use the quadratic formula, $-b\pm\sqrt{b↑2-4ac}\over 2a$, as an
example which combines both fractions and square roots.
To get it, we type \mm{-b\bs pm\bs sqrt\lb b\caret2 -4ac\rb\bs over 2a},
where \cmd{pm} gives the ``plus or minus'' sign.
Notice that we didn't need to enclose the numerator in braces.
However, if we wanted to write $x= \ldots$, then braces would be
required around {\tt -b\bs pm\bs sqrt\lb b\caret2 - 4ac\rb}; otherwise
we'd get the rather nonesensical expression $x=-b\pm\sqrt{b↑2-4ac}\over
2a$.
\section{Finer Points of Math Mode}
An alternative to the {\sl built up fractions} we saw earlier is to use
{\sl shillings fractions}, which make use of the regular {\sl slash}
character on the keyboard.\footnote{The name ``shilling'' apparently dates
from the old British monetary system, which expressed amounts in terms of
pounds, shilling and pence as {\it\$}/{\it s}/{\it d}.}
Thus, we could get ${a/b}\over{c/d}$ by typing \mm{\lb a/b\rb\bs over\lb
c/d\rb}.
In general, shilling fractions are preferred when formulas will be
displayed in-line with regular text, while built-up fractions are more
appropriate when in display math mode.
When using shilling fractions, its often necessary to use parentheses to
convey the true meaning: the equivalent of ${a+b}\over2$ is $(a+b)/2$, not
$a+b/2$.
Even though shillings look like ordinary text, its important to go into
math mode to type them if you want the spacing to come out correctly.
We said earlier that punctuation marks should always be typed outside math
mode.
Thus, in order to get ``for $x=a$, $b$, or $c$'', it is necessary to type
{\tt for \$x=a\$, \$b\$, or \$c\$}.
Sometimes we don't appreciate it when \TeX\ sets all letters inside math
mode in italics.
For example, the names of certain functions, such as `log' or `sin', are
conventionally set in roman type.
Luckily \TeX\ has special macros which do this, so that we can get $a=\log
b$ by typing \mm{a=\bs log b}.
A list of these functions can be found on page 162 of the \TeX book.
Other times we may want to get words in roman type to appear as subscripts
of variable names.
For example, to get $P_{\rm supply}$, it is necessary to specify roman
type, as follows: \mm{P\us\lb\bs rm supply\rb}.
Specifying roman type does not change the fact that \TeX\ throws away
spaces between words in math mode, however, so that if we have more than
one word in a subscript, we need to use control spaces to have them come
out correctly.
For example, we would type \mm{P\us\lb\bs rm long\bs\ run\rb} to get $P_{\rm
long\ run}$.
Putting the subscript inside of an \cmd{hbox} would take it out of math
mode, so that we would get roman type and inter-word spacing automatically;
however, \TeX\ would treat it as normal type rather than a subscript and
font size would be too large, as we can see from $P_{\hbox{long run}}$.
In general, it is important to be careful when using \cmd{hbox}es inside of
math mode; they won't look very good if you use them to create super- or
subscripts.
\section*{Assignment}
Reading for this lecture:
The {\sl \TeX book}, Chapters~16--17.
Assignment for this lecture:
Typeset the following.
$x + y + z$
If $x$ is the number of karrots, $y$ is the number of krackers, and $z$ is
the number of karpenters, then how many karrot kakes do
$x$, $y$, and $z$ make?
Brother, can you spare $x↑2 y↑{20}$ dimes?
The area of a $\bullet$ is $\pi r↑2$;
the circumference of a $\circ$ is $2\pi r$.
Will ${{(z↑5)}↑6}↑7$ porcupines fit in a breadbox?
${333↑3}_3$
$z = \sqrt{x↑2 + y↑2}$
$u↑\circ \mapsto (v\sqcup w) \cup f_*(x) \cap f↑+_*(y \cup z)$
If my brother is $x↑{\overline{q/\underline{r}}}$ years old, and his dog will
be $\root q \of {x_6' + y_{12}''}$ years old a week from next Thursday,
then how old is our mother's second cousin from Detroit?